package org.bminfo.migle.parser;

import java.io.IOException;

import server.MigleServerImpl;

public class ExSingleInfo {
	
	String miGLE_home = "";
	String moopPath = "";
	String tempRoot = "";
	String folderName = "";
	String tempPath = "";
	
	public void setPath(String path, String foldername){
		miGLE_home = path.replace("\\", "/");
		moopPath = miGLE_home + "WEB-INF/classes/org/bminfo/migle/miGLE/";
		tempRoot = miGLE_home + "temp/";
		folderName = foldername;
		tempPath = tempRoot + folderName + "/";	
		
		System.out.println(foldername);
		System.out.println(tempPath);
		System.out.println(moopPath);
	}
	
	public void exSingleInfo(String site, String type) throws IOException{

///* These code is for windows with perl scrpit
		String cmd_ExSingleInfo = "perl " + "\"" + moopPath + "ExSingleInfo.pl"
		+ "\" " + "report.txt " + site + " " + type + " ./list/";
//*/
		
/* These code is for windows with perl scrpit
		String cmd_ExSingleInfo = "perl " + moopPath + "ExSingleInfo.pl"
		+ " " + tempPath + "report.txt" + " "
		+ site + " " + type + " " + tempPath + "list/";
*/
		
/* These coding is for windows and linux with executable files
		String cmd_ExSingleInfo = "ExSingleInfo "
		+ tempPath + "report.txt" + " "
		+ site + " " + type + " " + tempPath + "list/";
*/
				
		System.out.println(cmd_ExSingleInfo);
		
		CommandExecutor exe = new CommandExecutor();
		exe.cmdExec(cmd_ExSingleInfo, tempPath);
		
	}
}
